About 508 letters

About 3 minutes

#bin

Description: Converts an integer to a binary string prefixed with 0b.

def bin(x: int):
    '''
    Converts an integer to a binary string prefixed with `0b`

    :param x: An integer
    :return: The binary string representation of x
    '''

Example:

print(bin(0))
print(bin(10))
print(bin(1024))

>>> Establishing WebAssembly Runtime.

>>> Standby.

Powered by Shift.

Updated: 6/9/2025

Author: PlanC

Created: 6/9/2025